package com.zhongwang.mms.module.material.model;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Calendar;
import java.util.Date;

/**
 * @Description: 库存划项目表
 * @Author: wsg
 * @Date: 2020/05/16
 */
@Data
public class MInventoryProjectMarkModel {

    @ExcelIgnore
    private Integer ipmId;  // 主键

    @ExcelIgnore
    private Integer ipmAfterItyId;  // 划后原料库存外键

    @ExcelIgnore
    private Integer ipmBeforeItyId; // 划前原料库存外键

    @ExcelProperty(value = "标记数量",index = 12)
    private Double ipmNum;  // 标记数量

    @ExcelProperty(value = "标记重量",index = 13)
    private Double ipmWeight;   // 标记重量

    @ExcelProperty(value = "标记时间",index = 17)
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date ipmDate;   // 标记时间

    @ExcelProperty(value = "标记人员",index = 16)
    private String ipmProposer; // 标记人员

    @ExcelProperty(value = "项目编号",index = 8)
    private String ipmInProjectCode;    // 划入的项目的项目编号

    @ExcelProperty(value = "项目名称",index = 9)
    private String ipmInProjectName;    // 划入的项目的项目名称称

    @ExcelProperty(value = "备注",index = 14)
    private String ipmRemark;   // 备注

    @ExcelIgnore
    private Integer ipmAppStatus;   // 添加状态 0删除 1未提交 2已提交 3执行 4驳回

    @ExcelProperty(value = "状态",index = 15)
    private String ipmAppStatusName;   // 添加状态 0删除 1未提交 2已提交 3执行 4驳回

    @ExcelIgnore
    private String ipmAccount;  // 帐号

    @ExcelProperty(value = "计划物料",index = 10)
    private String ipmNameDescExcel;    // 原料名称描述(Excel上传名称)

    @ExcelProperty(value = "申请重量",index = 11)
    private Double ipmWeightExcel;  // 申请重量(Excel上传重量)

    @ExcelIgnore
    private Date ipmChekcDate;  // 审核日期

    @ExcelIgnore
    private String ipmExecutor; // 审核人员

    @ExcelIgnore
    private Double ipmPrice;    // 单价

    @ExcelIgnore
    private Integer ipmRppId;   // 外键：依赖提报计划表主键

    @ExcelProperty(value = "类型",index = 0)
    private String matTypeName; // 类型

    @ExcelProperty(value = "材质",index = 1)
    private String matQualityName;  // 材质

    @ExcelProperty(value = "规格",index = 2)
    private String matSpecName; // 规格

    @ExcelProperty(value = "宽",index = 3)
    private Double matWidth;    // 宽

    @ExcelProperty(value = "长",index = 4)
    private Double matLength;   // 长

    @ExcelProperty(value = "米重/厚度",index = 5)
    private Double matHeight;   // 高

    @ExcelIgnore
   // @ExcelProperty(value = "物料描述",index = 0)
    private String matNameDesc; // 原料描述

    @ExcelProperty(value = "在库数量",index = 6)
    private Double ityNum;   // 在库数量
    @ExcelProperty(value = "在库重量",index = 7)
    private Double ityWeight;   // 在库重量

    @ExcelIgnore
    private Double ityAvaNum;   // 库存可用数量

    @ExcelIgnore
    private Double ityAvaWeight;    // 库存可用重量

    @ExcelIgnore
    private Integer matFormulaType; // 原料重量计算公式类别

    @ExcelIgnore
    private Integer sourceFlgQuery; // 检索页面区分 1=库存划项目标记记录 2=库存划项目执行

    @ExcelIgnore
    private Date startTimeQuery;    // 检索开始日期

    @ExcelIgnore
    private Date endTimeQuery;  // 检索结束日期
    public void setEndTimeQuery(Date endTimeQuery) {
        if (endTimeQuery != null) {
            Calendar cal = Calendar.getInstance();
            cal.setTime(endTimeQuery);
            cal.add(Calendar.DAY_OF_YEAR, +1);
            this.endTimeQuery = cal.getTime();
        } else {
            this.endTimeQuery = endTimeQuery;
        }
    }

    @ExcelProperty(value = "库位",index = 18)
    private String whiName;

}